<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>图书列表</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css">
  </head>
  <body>
    <a href="/">管理界面</a> || <a href="/booklist/toadd">添加图书</a> <br />
    <hr />
    <form action="/booklist" method="post">
      <table width="700" border="0">
        <h1>图书列表</h1>
        <tr>
          <td>图书ID</td>
          <td>图书信息</td>
          <td>操作</td>
        </tr>

        {% for item in booklist %}
        <tr>
          <td>
            {{item.id}}
          </td>
          <td>
            <img src="/uploads/{{item.filename}}" width="100" height="150" alt="">
            ￥{{item.price}},
            {{item.name}},
            {{item.des}},
            剩余{{item.stock}}
          </td>
          <td>
            <a href="/booklist/toupdate?id={{item.id}}">修改</a>/ {% if
            item.childs == '' %}
            <a
              href="/booklist/dodelete?id={{item.id}}"
              onclick="return confirm('是否删除图书【{{item.bookname}}】')"
              >删除</a
            >
          </td>
          {% endif %}
        </tr>
        {% endfor %}
        <tr>
          <td colspan="3">
            {% autoescape false %}
            {{fpage}}
            {% endautoescape %}
          </td>
        </tr>
      </table>
    </form>
  </body>
</html>
